package com.yanqu.road.server.manger.kowloon.battle.role.bullet;

import java.util.List;

import com.yanqu.road.server.manger.kowloon.battle.KowloonGame;
import com.yanqu.road.server.manger.kowloon.battle.role.enemy.KowloonEnemy;

/**
 * 落雷
 */
public class KowloonBulletBee extends KowloonBullet {

    private int atkNum;

    public KowloonBulletBee(KowloonGame game) {
        super(game);
    }

    @Override
    public void init() {
        this.atkNum = this.shooter.data.getProperty().getAttackNum();
    }

    @Override
    public void updateAI(double dt) {
        if (this.atkNum > 0) {
            KowloonEnemy enemy = this.getHitEnemy();
            if (enemy != null) {
                this.enemyIds.add(enemy.id);
                enemy.beHurt(this.bulletType, +this.shooter.data.getProperty().getAttack());
                this.atkNum--;
                if (this.atkNum <= 0) {
                    this.destroy();
                }
            }
        }
    }
}
